
// 计算捻缩系数
function sumnsxs(cpmc,cpxh,jjb,nsxss){
     var cpmcs   = $('#'+cpmc).val() ;
    var cpxhs   = $('#'+cpxh).val() ;
    if(cpmcs==""||cpmcs==null){
        alert("请选择产品名称");
        return;
    }
    if(cpxhs==""||cpxhs==null){
        alert("请选择产品型号");
        return;
    }

    if(cpmcs==1){
        var jjbs   = $('#'+jjb).val() ;
        objs=$.ajax({url:'/jsJjb/getnsxs?cpmc='+cpxhs+'&jjb='+jjbs,async:false});
        var cjxx =  objs.responseText
        $("#nsxss").attr("value",cjxx);
    }
}
// 计算产品重量
// 产品规格，产品系数，长度，镀锌量，捻缩系数，产品单价，产品数量，型号  ,nums
  function sumzl(cpmcs,cpggs,xs,cds,dxls,nsxss,cpdjs,cpsls,cpxhs){
      var sumzl="";
      if(cpmcs ==1){
          sumzl=(cpggs*cpggs*xs)*(1+dxls/1000)*cds/1000*cpxhs*nsxss*cpsls  ;
      }   else if(cpmcs ==2){
          sumzl=(cpggs*cpggs*xs)*(1+dxls/1000)*cds/1000*cpsls ;
      }  else if(cpmcs==3){
          sumzl=(cpggs*cpggs*xs*cds)/1000*cpsls  ;
      }
      return sumzl;
  }

//计算总价
function sumzj(cpmcs,cpggs,xs,cds,dxls,nsxss,cpdjs,cpsls,cpxhs){
    var nums="";
    if(cpmcs ==1){
        nums=(cpggs*cpggs*xs)*(1+dxls/1000)*cds/1000*cpxhs*nsxss*cpdjs*cpsls ;
    }   else if(cpmcs ==2){
        nums=(cpggs*cpggs*xs)*(1+dxls/1000)*cds/1000*cpdjs*cpsls ;
    }  else if(cpmcs==3){
        nums=(cpggs*cpggs*xs*cds)/1000*cpdjs*cpsls  ;
    }
    return nums;
}

function sumcd(cpmcs,cpggs,xs,cpzls,dxls,nsxss,cpdjs,cpsls,cpxhs){
    var cds="";
    if(cpmcs ==1){
        cds=cpzls/((cpggs*cpggs*xs)*(1+dxls/1000)/1000*cpxhs*nsxss*cpsls);
    }   else if(cpmcs ==2){
        cds=cpzls/((cpggs*cpggs*xs)*(1+dxls/1000)/1000*cpsls );
    }  else if(cpmcs==3){
        cds= cpzls/((cpggs*cpggs*xs)/1000*cpsls  )  ;
    }
    return cds;
}
